package org.dt.common.sequence.dal;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.dt.common.sequence.persist.CasSeqMapper;

/**
 * <p>creation time: 2019/01/21 18:31</p>
 *
 * @author yujiadong
 **/
public interface PolicyCasSeqMapper extends PolicyBaseSeqMapper, CasSeqMapper {
    //how to lock row after where clause finished -> stackoverflow
    //we can't do this
    @Update({"update t_agr_sequence set max_id=#{maxIdActual} where agr_biz_code=#{biz} and max_id=#{maxIdExcepted}"})
    @Override
    int updateMaxId(@Param("biz") String biz, @Param("maxIdExcepted") Long maxIdExcepted, @Param("maxIdActual") Long maxIdActual);
}
